
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>node.js · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="oracle.html" />
    
    
    <link rel="prev" href="nginx.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    starting
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../INTRODUCTION.html">
            
                <a href="../INTRODUCTION.html">
            
                    
                    introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    algorithm
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../algorithm/graphic_processing/">
            
                <a href="../algorithm/graphic_processing/">
            
                    
                    graphic_processing
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../algorithm/machine_learning/">
            
                <a href="../algorithm/machine_learning/">
            
                    
                    machine_learning
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../algorithm/other/">
            
                <a href="../algorithm/other/">
            
                    
                    other
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" >
            
                <span>
            
                    
                    language
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../language/cpp/">
            
                <a href="../language/cpp/">
            
                    
                    cpp
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../language/golang/">
            
                <a href="../language/golang/">
            
                    
                    golang
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../language/java/">
            
                <a href="../language/java/">
            
                    
                    java
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../language/javascript/">
            
                <a href="../language/javascript/">
            
                    
                    javascript
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../language/python/">
            
                <a href="../language/python/">
            
                    
                    python
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <span>
            
                    
                    soft_skills
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="docker.html">
            
                <a href="docker.html">
            
                    
                    docker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="git.html">
            
                <a href="git.html">
            
                    
                    git
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="ideaj.html">
            
                <a href="ideaj.html">
            
                    
                    ideaj
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="linux.html">
            
                <a href="linux.html">
            
                    
                    linux
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="maven.html">
            
                <a href="maven.html">
            
                    
                    maven
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="mysql.html">
            
                <a href="mysql.html">
            
                    
                    mysql
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.7" data-path="nginx.html">
            
                <a href="nginx.html">
            
                    
                    nginx
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.5.8" data-path="node.js.html">
            
                <a href="node.js.html">
            
                    
                    node.js
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.9" data-path="oracle.html">
            
                <a href="oracle.html">
            
                    
                    oracle
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.10" data-path="redis.html">
            
                <a href="redis.html">
            
                    
                    redis
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.11" data-path="script.html">
            
                <a href="script.html">
            
                    
                    script
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.12" data-path="skill.html">
            
                <a href="skill.html">
            
                    
                    skill
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.13" data-path="tcp-ip.html">
            
                <a href="tcp-ip.html">
            
                    
                    tcp-ip
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.14" data-path="ubuntu.html">
            
                <a href="ubuntu.html">
            
                    
                    ubuntu
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.15" data-path="vscode.html">
            
                <a href="vscode.html">
            
                    
                    vscode
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.16" data-path="windows.html">
            
                <a href="windows.html">
            
                    
                    windows
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >node.js</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
                                <section class="normal markdown-section">
                                
                                <h3 id="&#x914D;&#x7F6E;">&#x914D;&#x7F6E;</h3>
<p>&#x8BBE;&#x7F6E;&#x955C;&#x50CF;</p>
<pre><code class="lang-sh"><span class="hljs-comment"># &#x5B89;&#x88C5; cnpm</span>
npm install -g cnpm --registry=https://registry.npm.taobao.org

<span class="hljs-comment"># &#x8BBE;&#x7F6E;&#x6DD8;&#x5B9D;&#x955C;&#x50CF;</span>
npm config <span class="hljs-built_in">set</span> registry https://registry.npm.taobao.org
</code></pre>
<p>&#x8BBE;&#x7F6E;&#x4EE3;&#x7406;</p>
<pre><code class="lang-sh"><span class="hljs-comment"># &#x8BBE;&#x7F6E;&#x4EE3;&#x7406;</span>
npm config <span class="hljs-built_in">set</span> proxy http://10.17.192.11:80
npm config <span class="hljs-built_in">set</span> https-proxy http://10.17.192.11:80

<span class="hljs-comment"># &#x83B7;&#x53D6;&#x4EE3;&#x7406;&#x914D;&#x7F6E;</span>
npm config get proxy
npm config get https-proxy

<span class="hljs-comment"># &#x5220;&#x9664;&#x4EE3;&#x7406;&#x914D;&#x7F6E;</span>
npm config delete proxy
npm config delete https-proxy
</code></pre>
<h3 id="&#x5E38;&#x7528;&#x547D;&#x4EE4;">&#x5E38;&#x7528;&#x547D;&#x4EE4;</h3>
<table>
<thead>
<tr>
<th>Command</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>npm init -y</td>
<td>&#x521D;&#x59CB;&#x5316; package.json &#x6587;&#x4EF6;&#xFF0C;-y &#x662F; yes</td>
</tr>
</tbody>
</table>
<h3 id="gitbook">GitBook</h3>
<p>&#x5B89;&#x88C5;&#x6B65;&#x9AA4;</p>
<ol>
<li>&#x4F7F;&#x7528; <code>cnpm install -g gitbook-cli</code> &#x5B89;&#x88C5; gitbook &#x547D;&#x4EE4;&#x884C;&#x5DE5;&#x5177;</li>
<li>&#x521B;&#x5EFA;&#x76EE;&#x5F55; <strong>$HOME/.gitbook/versions</strong></li>
<li>&#x4E0B;&#x8F7D; <a href="https://github.com/GitbookIO/gitbook" target="_blank">gitbook</a> &#x7136;&#x540E;&#x89E3;&#x538B;&#x5230;&#x4E0A;&#x8FF0;&#x521B;&#x5EFA;&#x7684;&#x76EE;&#x5F55;, &#x5E76;&#x91CD;&#x547D;&#x540D;&#x4E3A;&#x7248;&#x672C;&#x53F7;, &#x5982; 3.2.3, &#x6700;&#x540E;&#x8FDB;&#x5165;&#x8BE5;&#x9879;&#x76EE;&#x6267;&#x884C; <code>cnpm install</code> &#x5B89;&#x88C5;&#x4F9D;&#x8D56;</li>
</ol>
<p>&#x5E38;&#x7528;&#x547D;&#x4EE4;</p>
<table>
<thead>
<tr>
<th>cmd</th>
<th>effect</th>
</tr>
</thead>
<tbody>
<tr>
<td>gitbook init</td>
<td>&#x521D;&#x59CB;&#x5316;&#x9879;&#x76EE;, &#x751F;&#x6210; summary.md &#x548C; readme.md</td>
</tr>
<tr>
<td>gitbook serve</td>
<td>&#x542F;&#x52A8;&#x9879;&#x76EE;, &#x9ED8;&#x8BA4;&#x4E3A; <a href="http://localhost:4000" target="_blank">http://localhost:4000</a></td>
</tr>
<tr>
<td>gitbook build</td>
<td>&#x6784;&#x5EFA;&#x9879;&#x76EE;</td>
</tr>
</tbody>
</table>
<p>FAQ</p>
<ul>
<li>gitbook &#x5E38;&#x7528;&#x7248;&#x672C;&#x6709; 2.6.9 &#x548C; 3.2.3, &#x4F46;&#x524D;&#x8005;&#x53EA;&#x652F;&#x6301; node 6 &#x4EE5;&#x4E0B;&#x7684;&#x7248;&#x672C;, &#x800C;&#x540E;&#x8005;&#x9690;&#x542B;&#x4E00;&#x4E2A; bug, &#x4F7F;&#x7528;&#x540E;&#x8005;&#x65F6;&#x9700;&#x8981;&#x6CE8;&#x91CA;&#x6389; <strong>$HOME/.gitbook/versions/3.2.3/lib/output/website/copyPluginAssets.js::112</strong> (confirm: true)</li>
<li>gitbook &#x7535;&#x5B50;&#x4E66;&#x7684;&#x6E90;&#x7801;&#x4E0D;&#x80FD;&#x76F4;&#x63A5;&#x5728;&#x7F51;&#x7AD9;&#x4E0A;&#x4E0B;&#x8F7D;, &#x9700;&#x8981;&#x4F7F;&#x7528; git &#x5230; gitbook &#x7684; git &#x4ED3;&#x5E93;&#x4E2D;&#x4E0B;&#x8F7D;, &#x547D;&#x4EE4;&#x4E3A; <code>git clone https://git.gitbook.com/{username}/{bookname}.git</code>, <em>(&#x4E0B;&#x8F7D;&#x65F6;&#x9700;&#x8981;&#x767B;&#x9646; gitbook &#x8D26;&#x53F7;)</em></li>
</ul>
<h3 id="vue">Vue</h3>
<p>&#x5B89;&#x88C5;&#x53CA;&#x4F7F;&#x7528;</p>
<pre><code class="lang-sh"><span class="hljs-comment"># &#x5B89;&#x88C5; vue &#x811A;&#x624B;&#x67B6;</span>
cnpm install -g vue-cli

<span class="hljs-comment"># &#x4F7F;&#x7528; webpack &#x6A21;&#x677F;&#x521D;&#x59CB;&#x5316;&#x4E00;&#x4E2A; vue &#x9879;&#x76EE;</span>
vue init webpack <span class="hljs-variable">${project}</span>

<span class="hljs-comment"># &#x6DFB;&#x52A0;&#x5176;&#x4ED6;&#x4F9D;&#x8D56;</span>
cnpm install -S element-ui axios
</code></pre>
<p>FAQ</p>
<ul>
<li>&#x52A0;&#x8F7D;&#x9875;&#x9762;&#x65F6;, &#x8BA9;&#x8F93;&#x5165;&#x6846;&#x805A;&#x7126;</li>
</ul>
<pre><code class="lang-javascript"><span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> {
    <span class="hljs-comment">// ...</span>
    mounted: {
        <span class="hljs-comment">// &#x9519;&#x8BEF;, &#x9875;&#x9762;&#x52A0;&#x8F7D;&#x672A;&#x5B8C;&#x6210;</span>
        <span class="hljs-comment">// document.getElementById(&apos;input&apos;).focus()</span>

        setTimeout(() =&gt; {
            <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">&apos;input&apos;</span>).focus()
        }, <span class="hljs-number">100</span>);
    }
}
</code></pre>

                                
                                </section>
                            
                        </div>
                    </div>
                
            </div>

            
                
                <a href="nginx.html" class="navigation navigation-prev " aria-label="Previous page: nginx">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="oracle.html" class="navigation navigation-next " aria-label="Next page: oracle">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"node.js","level":"1.5.8","depth":2,"next":{"title":"oracle","level":"1.5.9","depth":2,"path":"soft_skills/oracle.md","ref":"soft_skills/oracle.md","articles":[]},"previous":{"title":"nginx","level":"1.5.7","depth":2,"path":"soft_skills/nginx.md","ref":"soft_skills/nginx.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["-search","-sharing","-lunr"],"pluginsConfig":{"highlight":{},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"soft_skills/node.js.md","mtime":"2019-12-11T13:58:02.981Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-03-17T16:45:36.070Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

